package com.zx._01_基础._012_反射;

import java.io.Serializable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;

@Repository
@Controller
public class ReflectModel implements Serializable {

    private static final long serialVersionUID = 1L;

    public int age;

    @Autowired(required = false)
    private String name;

    public ReflectModel() {
        System.out.println("创建对象==公共构造器");
    }

    private ReflectModel(String name) {
        this.name = name;
        System.out.println("创建对象==私有有参构造器");
    }

    public static String go(String name) {
        return "1" + name;
    }

    public void info() {
        System.out.println("公共无参方法");
    }

    public void info(String name) {
        System.out.println("公共有参方法");
    }

    private void pmethod() {
        System.out.println("内部私有方法");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "ReflectModel [name=" + name + ", age=" + age + "]";
    }

    class HaHa {

        public void get() {
            System.out.println("内部类");
        }
    }
}
